home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / STRIP.CC < prev    next >
Text File  |  1993-04-04  |  284b  |  17 lines

  1. strip(char *str, char c)
  2. /* This will string all occurances of char c out of string pointed to by *str */
  3. {
  4.    char *newstr;
  5.  
  6.    newstr = str;
  7.    while (*str) {
  8.     if (*str != c) {
  9.         *newstr=*str;
  10.         newstr++;
  11.         str++;
  12.       }
  13.     else str++;
  14.     }
  15.    *newstr = '\0';
  16. }
  17.